{extend name="$_tpl_public_layout_ace"/}


{block name="breadcrumb"}
<ul class="breadcrumb">
	<li><i class="fa fa-home home-icon"></i><a href="{:url('manage/index/index')}">{:config('web_site_title')}</a></li>
	<li><a href="{:url('seatsel/manage/index')}">{:config('proj_name')}</a></li>
	<li><a href="{:url('seatsel_manage/product/index')}">{$sideName}</a></li>
</ul>
{/block}


{block name="pageheader"}
<h1>
	{$sideName}
</h1>
{/block}


{block name="content"}
<!-- 搜索框 -->
<form method="get" action="{:url('seatsel_manage/product/index')}" class="form-inline mb20 J_ajaxForm">
	<div class="mb10">
		<div class="form-group">
			<label>商品状态：</label>
			<select name="status" class="form-control">
				<option value="0">全部</option>
				{volist name="product_status_config" id="vo"}
					<?php
						$selected = $status == $key ? 'selected' : '';
					?>
					<option value="{$key}" {$selected}>{$vo}</option>
				{/volist}
			</select>
		</div>
		<div class="form-group">
			<label>名称：</label>
			<input type="text" name="name" value="{$name}" class="form-control zz-length4" />
		</div>
	</div>
	<div class="mb10">
		<div class="form-group">
			<label>开始时间：</label>
			<input type="text" name="start_time" value="{$start_time}" class="form-control zz-length3 J_datetimepicker" />
		</div>
		<div class="form-group">
			<label>结束时间：</label>
			<input type="text" name="end_time" value="{$end_time}" class="form-control zz-length3 J_datetimepicker" />
		</div>
	</div>
	<button type="submit" data-action="{:url('seatsel_manage/product/index')}" class="btn btn-success btn-sm J_excel">搜索</button>
</form>
<hr>
<!-- 搜索框 -->

<?php
${'active_'.$status} = 'active';
?>
<ul class="inbox-tabs nav nav-tabs padding-16 tab-size-bigger tab-space-1 mb20">
	<li class="{$active_0}">
		<a href="{:url('seatsel_manage/product/index', ['status'=>0])}">全部</a>
	</li>
	{volist name="product_status_config" id="vo"}
	<?php
		$active = $status == $key ? 'active' : '';
	?>
	<li class="{$active}">
		<a href="{:url('seatsel_manage/product/index', ['status'=>$key])}">{$vo}</a>
	</li>
	{/volist}
</ul>

<div class="mb10">
	<a href="{:url('seatsel_manage/product/add')}" class="btn btn-primary btn-sm"><i class="fa fa-pencil align-top bigger-125"></i> 添加</a>
</div>

<form method="post" action="{:url('seatsel_manage/product/index')}" class="J_check_wrap J_ajaxForm">
	<table class="table table-striped table-bordered table-hover dataTables-table">
		<thead>
			<tr>
				<th width="50"><input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y"></th>
				<th width="60">ID</th>
				<th width="80">类别</th>
				<th width="80">封面</th>
				<th>名称</th>
				<th width="80">库存</th>
				<th width="80">销售</th>
				<th width="120">点击数</th>
				<th width="70">状态</th>
				<th width="146">创建时间</th>
				<th width="160">操作</th>
			</tr>
		</thead>
		<tbody>
			{volist name="list" id="vo"}
			<tr>
				<td><input type="checkbox" name="ids[]" value="{$vo['id']}" class="J_check" data-yid="J_check_y" /></td>
				<td>{$vo['id']}</td>
				<td>{$categoryList[$vo['cid']]['name']}</td>
				<td><img src="{$vo['picurl']}" width="80" /></td>
				<td><a href="{:url('seatsel_manage/product/getDemoUrl', ['id'=>$vo['id']])}" class="J_layerPcDialog" data-tip="查看二维码">{$vo['name']}</a></td>
				<td>{$vo['stock_num']}</td>
				<td>{$vo['sale_num']}</td>
				<td>{$vo['hit_num']}</td>
				<td>
					<div class="btn-group">
						<button type="button" class="btn btn-pink btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
							{$vo['status_show']} <i class="fa fa-angle-down"></i>
						</button>
						<ul class="dropdown-menu">
							<li><a href="{:url('seatsel_manage/product/setStatus', ['id'=>$vo['id'], 'flag'=>1])}" class="J_ajaxSend">待审核</a></li>
							<li><a href="{:url('seatsel_manage/product/setStatus', ['id'=>$vo['id'], 'flag'=>2])}" class="J_ajaxSend">出售中</a></li>
							<li><a href="{:url('seatsel_manage/product/setStatus', ['id'=>$vo['id'], 'flag'=>3])}" class="J_ajaxSend">已下架</a></li>
						</ul>
					</div>
				</td>
				<td>{$vo['create_time_show']}</td>
				<td>
					<div>
						<a href="{:url('seatsel_manage/product/add', ['id'=>$vo['id']])}" class="btn btn-primary btn-xs">编辑</a>
						<a href="{:url('seatsel_manage/product/contentEdit', ['id'=>$vo['id']])}" class="btn btn-info btn-xs">编辑内容</a>
					</div>
					<div class="mt5">
						<a href="{:url('seatsel_manage/product/doDelete', ['id'=>$vo['id']])}" class="btn btn-danger btn-xs J_layerConfirm" data-tip="确认删除吗？">删除</a>
					<div class="mt5">
						<a href="{:url('seatsel_manage/spec/index', ['pid'=>$vo['id']])}" class="btn btn-success btn-xs">管理场次</a>
						<a href="{:url('seatsel_manage/order/index', ['pid'=>$vo['id']])}" class="btn btn-primary btn-xs">查看订单</a>
					</div>
				</td>
			</tr>
			{/volist}
		</tbody>
	</table>
	<div class="dataTables-controll">
		<button type="submit" class="btn btn-info btn-sm J_layerConfirmSubmit" data-action="{:url('seatsel_manage/product/setStatus', ['flag'=>'1'])}" data-tip="确认设置待审核吗？">待审核</button>
		<button type="submit" class="btn btn-success btn-sm J_layerConfirmSubmit" data-action="{:url('seatsel_manage/product/setStatus', ['flag'=>'2'])}" data-tip="确认设置出售中吗？">出售中</button>
		<button type="submit" class="btn btn-danger btn-sm J_layerConfirmSubmit" data-action="{:url('seatsel_manage/product/setStatus', ['flag'=>'2'])}" data-tip="确认设置已下架吗？">已下架</button>
	</div>
</form>
<div class="dataTables-pages">{$pageShow}</div>
{/block}


{block name="script"}
<!--时间选择器-->
{include file="./tplnew/public/script_datetimepicker.html" /}
{/block}